Library Vcl NextSuite 6 NextGrid6 Reference Classes TNxCell6 Location

Location

Represent cell location (column and row index) as TPoint.

property Location: TPoint read GetLocation;

Location is not re-calculated on each access to this property, instead it is set after calling Cell array property of Grid. If you use this property immediately after accessing Cell property there will be no issues and code will be fast.

In this situations there may be problems:

var
  MyCell: TNxCell6;
  MyRowVar: Integer;
begin
  MyRowVar := NextGrid61.SelectedRow;
  MyCell := NextGrid61.Cell[0, MyRowVar];

  // Drastic data changes
  NextGrid61.Columns[2].Sorted := True;

  // Cell is maybe not at the same position now
  if MyCell.Location.Y = MyRowVar then ...

To force re-calculation, use ComputedLocation property instead.

Remarks

This property is TPoint combination of ColIndex and RowIndex properties:

function TNxCell6.GetLocation: TPoint;
begin
  Result := Point(ColIndex, RowIndex);
end;

Sign in